#!/bin/bash
folder="/Users/$USER/terminal-random-theme/terminal_model"

# 获取 .terminal 文件的列表
files=($(find "$folder" -maxdepth 1 -type f -name "*.terminal"))

# 获取文件数量
file_count=$(find "$folder" -maxdepth 1 -type f -name "*.terminal" | wc -l)

#随机数
num=$[RANDOM%$file_count+1]

# 获取随机选择的文件
selected_file=${files[$num]}

open "$selected_file"

open -a Terminal && osascript -e 'tell application "Terminal" to set the bounds of the front window to {420, 0, 1020, 120}'
cd ~/Desktop

clear